<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AlterBannersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('banners', function (Blueprint $table) {
            $table->string('title',500)->default('')->comment('标题')->change();
            $table->string('image')->default('')->comment('banner图片')->change();
            $table->string('url')->default('')->comment('链接地址')->change();
            $table->integer('sort')->default(0)->comment('banner排序')->change();
            $table->integer('is_show')->default(0)->comment('是否展示')->change();
            $table->integer('type')->default('0')->comment('文字or图片');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('banners', function (Blueprint $table) {
             $table->dropColumn('type');
        });
    }
}
